class ApplicationCommand(object):
    """docstring for ApplicationCommand"""
    
    #APPLICATION COMMAND CODE
    CONFIGURE_AFI = 1
    CONFIGURE_DSFID = 2
    INVENTORY_TAGS = 3
    DELETE_OBJECT = 5
    MODIFY_OBJECT = 6
    READ_OBJECT_IDENTIFIERS = 8
    READ_LOGICAL_MEMORY_MAP = 10
    ERASE_MEMORY = 12
    GET_APP_BASE_SYSTEM_INFO = 13
    WRITE_OBJECT = 17
    READ_OBJECTS = 18
    WRITE_OBJECTS_SEGMENTED_MEMORY_TAG = 19
    WRITE_EPC_UII = 20
    INVENTORY_ISO_UIIMEMORY = 21
    INVENTORY_EPC_UIIMEMORY = 22
    WRITE_PASSWORD_SEGMENTED_MEMORY_TAG = 23
    READ_WORDS_SEGMENTED_MEMORY_TAG = 24
    KILL_SEGMENTED_MEMORY_TAG = 25
    
    #MEMORY BANK TYPE
    UII = '0'
    USER = '2'
    TID = '1'
    
    #UNITED TYPE
    BOOLEAN = '01'
    INTEGER = '02'
    OBJECT_IDENTIFIER = '06'
    OCTET_STRING = '04'
    RELATIVE_OID = '0d'
    SEQUENCE_AND_SEQUENCE_OF = '30'
    
    ENCODED_COMMAND = ""
    
    def __init__(self):
        pass

    def generateCommand(command,  tagId='', memoryBank='', accessPassword='', AFI = '', DSFID='', addObjectsList='', readType='', identifyMethod = '', numberOfTags = '', readObjectsList='', objectIdentifier='', checkDuplicate=''):
        if command == ApplicationCommand.CONFIGURE_AFI:
            pass
        elif command == ApplicationCommand.CONFIGURE_DSFID:
            pass
        elif command == ApplicationCommand.INVENTORY_TAGS:
            return InventoryTagsCommand(AFI, identifyMethod, numberOfTags)
        elif command == ApplicationCommand.DELETE_OBJECT:
            return DeleteObjectCommand(tagId, objectIdentifier, checkDuplicate)
        elif command == ApplicationCommand.MODIFY_OBJECT:
            pass
        elif command == ApplicationCommand.READ_OBJECT_IDENTIFIERS:
            pass
        elif command == ApplicationCommand.READ_LOGICAL_MEMORY_MAP:
            pass
        elif command == ApplicationCommand.ERASE_MEMORY:
            return EraseMemoryCommand(tagId)
        elif command == ApplicationCommand.GET_APP_BASE_SYSTEM_INFO:
            pass
        elif command == ApplicationCommand.WRITE_OBJECT:
            pass
        elif command == ApplicationCommand.READ_OBJECTS:
            return ReadObjectsCommand(tagId, readType, readObjectsList)
        elif command == ApplicationCommand.WRITE_OBJECTS_SEGMENTED_MEMORY_TAG:
            return WriteObjectsSegmentedMemoryTagCommand( tagId, memoryBank, accessPassword, AFI, DSFID, addObjectsList)
        elif command == ApplicationCommand.WRITE_EPC_UII:
            pass
        elif command == ApplicationCommand.INVENTORY_ISO_UIIMEMORY:
            pass
        elif command == ApplicationCommand.INVENTORY_EPC_UIIMEMORY:
            pass
        elif command == ApplicationCommand.WRITE_PASSWORD_SEGMENTED_MEMORY_TAG:
            pass
        elif command == ApplicationCommand.READ_WORDS_SEGMENTED_MEMORY_TAG:
            pass
        elif command == ApplicationCommand.KILL_SEGMENTED_MEMORY_TAG:
            pass
    generateCommand = staticmethod(generateCommand)

    def encode(self):
        """docstring for encode"""
        pass
    
    def decode(self):
        """docstring for decode"""
        pass

    def _convertToHexString(self):
        for l in self.listCmdAndData:
            for s in l:
                self.ENCODED_COMMAND += s
    
    def _popData(self, hexLen):
        self.data = self.data[hexLen:]

from WriteObjectsSegmentedMemoryTagCommand import WriteObjectsSegmentedMemoryTagCommand
from ReadObjectsCommand import ReadObjectsCommand
from EraseMemoryCommand import EraseMemoryCommand
from InventoryTagsCommand import InventoryTagsCommand
from DeleteObjectCommand import DeleteObjectCommand

if __name__ == '__main__':
    ApplicationCommand.generateCommand(ApplicationCommand.WRITE_OBJECTS_SEGMENTED_MEMORY_TAG)
    
